//
//  DrawView2.m
//  30206
//
//  Created by student on 16/4/7.
//  Copyright © 2016年 NIIT. All rights reserved.
//

#import "DrawView2.h"

@implementation DrawView2

- (void)drawRect:(CGRect)rect
{
    CGContextRef ctx = UIGraphicsGetCurrentContext();
    
    UIBezierPath *path=[UIBezierPath bezierPath];
    [path moveToPoint:CGPointMake(10, 125)];
    [path addLineToPoint:CGPointMake(240, 125)];
    CGContextAddPath(ctx, path.CGPath);
    CGContextSetLineWidth(ctx, 10);
    [[UIColor redColor] set];
    CGContextSaveGState(ctx);
    CGContextStrokePath(ctx);
    
    path=[UIBezierPath bezierPath];
    [path moveToPoint:CGPointMake(125, 10)];
    [path addLineToPoint:CGPointMake(125, 240)];
    CGContextAddPath(ctx, path.CGPath);
    CGContextSetLineWidth(ctx, 20);
    [[UIColor redColor] set];
    CGContextStrokePath(ctx);
    
    path=[UIBezierPath bezierPath];
    [path moveToPoint:CGPointMake(10, 10)];
    [path addLineToPoint:CGPointMake(240, 240)];
    CGContextAddPath(ctx, path.CGPath);
    CGContextRestoreGState(ctx);
    CGContextStrokePath(ctx);

    
}


@end
